package cn.wolfcode.luowowo.mgrsite.controller;

import cn.wolfcode.luowowo.comment.query.TravelCommentQuery;
import cn.wolfcode.luowowo.comment.service.ITravelCommentService;
import cn.wolfcode.luowowo.comment.service.ITravelCommentService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by admin on 2019/8/13.
 */
@Controller
@RequestMapping("/travelComment")
public class TtavelCommentController {


    @Reference
    private ITravelCommentService commentService;

    @RequestMapping("/list")
    public String comment(Model model, @ModelAttribute("qo") TravelCommentQuery qo) {

        Page query = commentService.query(qo);

        Pageable pageable = query.getPageable();
        pageable.getPageNumber();
        model.addAttribute("pageInfo", commentService.query(qo));

        return "comment/Travellist";
    }
}
